\name{ChIPQC}
\alias{ChIPQC}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
ChIPQC single sample function
}
\description{
%%  ~~ A concise (1-5 lines) description of what the function does. ~~
}
\usage{
ChIPQC(bamFile, bedFile,blklist,GeneAnnotation,ChrOfInterest = NULL, Window = 400, FragmentLength = 50, shiftWindowStart = 1, shiftWindowEnd = 2, mapQCutoff = 15)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{bamFile}{
Character vector of bamfile location
}
  \item{bedFile}{
Character vector of peak file location in bed6 format
}
  \item{blklist}{
Character vector of blacklist file location in bed6 format
}
  \item{bedFile}{
Character vector of Gene annotation..currently only supports hg19
}

  \item{ChrOfInterest}{
Character vector of chromosome names to be use in analysis. Default is all chromosomes.
}
  \item{Window}{
Numeric vector of size of window around peak for calcualting average signal across peaks.
}
  \item{FragmentLength}{
Numeric vector of Predicted/Known fragment length
}
  \item{shiftWindowStart}{
Numeric vector of start position for cross-correlation shift. Default is 1
}
  \item{shiftWindowEnd}{
Numeric vector of start position for cross-correlation shift. Default is 300
}
  \item{mapQCutoff}{
Numeric vector of mapq quality cut off.
}
}
\details{
%%  ~~ If necessary, more details than the description above ~~
}
\value{
%%  ~Describe the value returned
%%  If it is a LIST, use
%%  \item{comp1 }{Description of 'comp1'}
%%  \item{comp2 }{Description of 'comp2'}
%% ...
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%%  ~~who you are~~
}
\note{
%%  ~~further notes~~
}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
%% ~~objects to See Also as \code{\link{help}}, ~~~
}
\examples{
library(chipqcreport03)
## Sample File
bamFile <- "C:\\Users\\carrol09\\Dropbox\\Tom\\chipqcbioc\\Data\\CRUK_Data\\ERR336952.bwa.RealignedGRCh37_Processed.bam"
## Input File
bamFile2 <- "C:\\Users\\carrol09\\Dropbox\\Tom\\chipqcbioc\\Data\\CRUK_Data\\ERR336953.bwa.RealignedGRCh37_Processed.bam"
## Peak File
bedFile <-  "C:\\Users\\carrol09\\Dropbox\\Tom\\chipqcbioc\\Data\\CRUK_Data\\jc1203_MCF7_ER_ChIP-seq_repB_hg19_MACS2_jc899_peaks.bed"

## Run QC
temp2 <- ChIPQC(bamFile2,bedFile,shiftWindowStart=1,shiftWindowEnd=300)
temp1 <- ChIPQC(bamFile,bedFile,shiftWindowStart=1,shiftWindowEnd=300)

## Cross-coverage 5'read ends plot
par(mfrow=c(1,2))
NormalisedCrossCoverageSample <- (max(temp1@NaiveCrossCorrelation)-temp1@NaiveCrossCorrelation)/max(temp1@NaiveCrossCorrelation)
NormalisedCrossCoverageInput <- (max(temp2@NaiveCrossCorrelation)-temp2@NaiveCrossCorrelation)/max(temp2@NaiveCrossCorrelation)
plot(NormalisedCrossCoverageSample,ylab="Proportion_Covered",xlab="Shift",type="l",lwd=3)
lines(NormalisedCrossCoverageInput,col="red",lwd=3)
 ## Average Peak signal plot
plot(temp1@AveragePeakSignal[[2]],ylab="Normalised Signal Height",xlab="Distance around summit",type="l",lwd=3,ylim=c(0,2))
lines(temp2@AveragePeakSignal[[2]],lwd=3,col="red")

}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ ~kwd1 }
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
